<?php
	namespace Pages;
	class NewMessage implements Page {
		public function __construct(){
		}
		public function exec($data){
			if(isset($data['pseudo']) && !empty($data['pseudo']) && isset($data['message']) && !empty($data['message'])){
				$m = \Model\Model::getInstance();
				$m->postMessage($data['pseudo'],$data['message']);
				return 'index.html';
			}
		}
		public function toXML(){
			$xml = new \DOMDocument();
			$xml->load('Pages/NewMessage.xml');
			return $xml;
		}
		public function getXSL($format){
			$xml = new \DOMDocument();
			$xml->load('XSL/html/NewMessage.xsl');
			return $xml;
		}
	}
?>
